// mycomponent/diyBackGround/diyBackGround.js
const skinBehavior = require('../../utils/themeSkin/skinBehavior');
var app = getApp();
Component({
  behaviors: [skinBehavior],
  /**
   * 组件的属性列表
   */
  properties: {
    minHeight: {
      type: String,
      value: "348rpx"
    },
    navigationStyle: {
      type: Boolean,
      value: false
    },
    diyTitle: {
      type: Boolean,
      value: false
    }
  },
  lifetimes: {
    attached() {
      if (this.properties.navigationStyle) {
        wx.getSystemInfo({
          success: (res) => {
            console.log(res.statusBarHeight, '状态栏高度')
            console.log(wx.getMenuButtonBoundingClientRect(), '按钮')
            let custom = wx.getMenuButtonBoundingClientRect();
            let customBar = custom.bottom + custom.top - res.statusBarHeight;
            this.setData({
              customBarHeight: customBar,
              statusBarHeight: res.statusBarHeight,
              customHeight: custom.height,
              custom: custom
            })
            console.log(customBar)
          }
        })
      }
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    themeStyle: null
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getData() {
      let urlStr = app.getNetAddresss("home-page.wxapp");
      app._getNetWork({
        url: urlStr,
        success: function (resdata) {
          var res = resdata.data;

        },
        fail: function (res) {
          console.log(res);
        }
      });
    }
  }
})